package net.guerlab.smart.wx.core.searchparams;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import net.guerlab.spring.searchparams.AbstractSearchParams;
import net.guerlab.spring.searchparams.OrderByType;
import net.guerlab.spring.searchparams.SearchModel;
import net.guerlab.spring.searchparams.SearchModelType;

import javax.persistence.Column;
import java.time.LocalDateTime;
import java.util.Collection;

/**
 * 微信用户搜索参数
 *
 * @author guer
 */
@Setter
@Getter
@ApiModel("微信用户搜索参数")
public class WxUserSearchParams extends AbstractSearchParams {

    /**
     * openId
     */
    @ApiModelProperty("openId")
    private String openId;

    /**
     * openId列表
     */
    @ApiModelProperty(hidden = true)
    @Column(name = "openId")
    @SearchModel(SearchModelType.IN)
    private Collection<String> openIds;

    /**
     * 应用ID
     */
    @ApiModelProperty("应用ID")
    private String appId;

    /**
     * unionId
     */
    @ApiModelProperty("unionId")
    private String unionId;

    /**
     * 昵称
     */
    @ApiModelProperty("昵称")
    @Column(name = "nickName")
    @SearchModel(SearchModelType.LIKE)
    private String nickNameLike;

    /**
     * 注册时间开始范围
     */
    @ApiModelProperty("注册时间开始范围")
    @Column(name = "registryTime")
    @SearchModel(SearchModelType.GREATER_THAN_OR_EQUAL_TO)
    private LocalDateTime registryTimeStartWith;

    /**
     * 注册时间结束范围
     */
    @ApiModelProperty("注册时间结束范围")
    @Column(name = "registryTime")
    @SearchModel(SearchModelType.LESS_THAN_OR_EQUAL_TO)
    private LocalDateTime registryTimeEndWith;

    /**
     * 最后登录时间开始范围
     */
    @ApiModelProperty("最后登录时间开始范围")
    @Column(name = "lastLoginTime")
    @SearchModel(SearchModelType.GREATER_THAN_OR_EQUAL_TO)
    private LocalDateTime lastLoginTimeStartWith;

    /**
     * 最后登录时间结束范围
     */
    @ApiModelProperty("最后登录时间结束范围")
    @Column(name = "lastLoginTime")
    @SearchModel(SearchModelType.LESS_THAN_OR_EQUAL_TO)
    private LocalDateTime lastLoginTimeEndWith;

    /**
     * 账号是否已激活
     */
    @ApiModelProperty("账号是否已激活")
    private Boolean activated;

    /**
     * 标签ID
     */
    @ApiModelProperty("标签ID")
    @SearchModel(SearchModelType.IGNORE)
    private Long tagId;

    /**
     * 标签ID列表
     */
    @ApiModelProperty("标签ID列表")
    @SearchModel(SearchModelType.IGNORE)
    private Collection<Long> tagIds;

    /**
     * 是否查询标签
     */
    @ApiModelProperty("是否查询标签")
    @SearchModel(SearchModelType.IGNORE)
    private Boolean queryTags;

    /**
     * 注册时间排序方式
     */
    @ApiModelProperty(hidden = true)
    @Column(name = "registryTime")
    @JsonIgnore
    private OrderByType registryTimeOrderByType = OrderByType.DESC;
}
